/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package us.icitap.cm.business.entities.regmin;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 *
 * @author klau
 */
@Entity
@Table(name = "MUNICIP_COMMUNE", schema="REGMIN")
public class MunicipCommune implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "CODE_MUNICIP_COMMUNE", nullable = false)
    private String codeMunicipCommune;
    @Column(name = "TAG")
    private String tag;
    @Column(name = "COMMUNE")
    private Character commune;


    @JoinColumn(name = "CODE_DISTRICT", referencedColumnName = "CODE_DISTRICT")
    @ManyToOne
    private District district;

    public MunicipCommune() {
    }

    public MunicipCommune(String codeMunicipCommune) {
        this.codeMunicipCommune = codeMunicipCommune;
    }

    public String getCodeMunicipCommune() {
        return codeMunicipCommune;
    }

    public void setCodeMunicipCommune(String codeMunicipCommune) {
        this.codeMunicipCommune = codeMunicipCommune;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public Character getCommune() {
        return commune;
    }

    public void setCommune(Character commune) {
        this.commune = commune;
    }



    public District getDistrict() {
        return district;
    }

    public void setDistrict(District district) {
        this.district = district;
    }

  


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codeMunicipCommune != null ? codeMunicipCommune.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MunicipCommune)) {
            return false;
        }
        MunicipCommune other = (MunicipCommune) object;
        if ((this.codeMunicipCommune == null && other.codeMunicipCommune != null) || (this.codeMunicipCommune != null && !this.codeMunicipCommune.equals(other.codeMunicipCommune))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.MunicipCommune[codeMunicipCommune=" + codeMunicipCommune + "]";
    }

}
